/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * com_distri_articulos_invefisico_detalle.java
 *
 * Created on 24/01/2012, 09:34:02 AM
 */

package sie_invdis;


import java.sql.*;
import javax.swing.*;
import java.awt.*;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Calendar;

import java.text.ParseException;
import java.text.*;

/**
 *
 * @author Michelle
 */
public class com_distri_articulos_invefisico_detalle extends javax.swing.JFrame {


    private javax.swing.table.DefaultTableModel jtable_modelo;
    private javax.swing.table.DefaultTableModel jtable_modelo_catalogo;
     private javax.swing.table.DefaultTableModel jtable_modelo_diferencias;
     private javax.swing.table.DefaultTableModel jtable_modelo_subfam;
     private javax.swing.table.DefaultTableModel jtable_modelo_familia;
     private javax.swing.table.DefaultTableModel jtable_modelo_familiaeninve;
     private javax.swing.table.DefaultTableModel jtable_modelo_subfameninve;
     private javax.swing.table.DefaultTableModel jtable_modelo_Articeninve;
     private javax.swing.table.DefaultTableModel jtable_modelo_Artihistorifisico;
    private bd_conexion x = new bd_conexion() ;
       //se creaa la variable resultset
      private ResultSet rs = null;
      int controlcombo=0,ffoliopadre=0,ffoliohijo=0,indexactual=0,yacargue2=0,yacargue1=0;
      private SimpleDateFormat formateador = new SimpleDateFormat("dd-MM-yyyy");
      private SimpleDateFormat formateadoresta = new SimpleDateFormat("yyyy-MM-dd");

    /** Creates new form com_distri_articulos_invefisico_detalle */
       public com_distri_articulos_invefisico_detalle() {
       }
       
    public com_distri_articulos_invefisico_detalle(int folioinvepadre,int folioinvehijo) {
        this.iniciar_modelo_de_tabla();
        this.iniciar_modelo_catalogo();
        this.iniciar_modelo_diferencias();
        this.iniciar_modelo_subfam();
        this.iniciar_modelo_familia();
        this.iniciar_modelo_familiaeninventario();
        this.iniciar_modelo_subfameninve();
        this.iniciar_modelo_articuloseninve();
        this.iniciar_modelo_articulofisicohistorial();
        initComponents();
         this.jtf_idinve.setText(String.valueOf(folioinvepadre));
        
        ffoliopadre=folioinvepadre;
        
        ffoliohijo=folioinvehijo;
        this.carga_datos_catalogo(ffoliopadre,0,"");
        this.jbtn_autorizarinventario.setVisible(false);
        this.jbtn_agregarainvecongelado.setVisible(false);
        this.jbtn_congelarexistencias.setVisible(false);
        this.jbtn_cancelar.setVisible(false);
       
        if (variables_global.getnivelusu()<3)
                    {
                        this.jbtn_congelarexistencias.setVisible(true);
                    }
       jt_inventariofisicodetalle.getColumnModel().getColumn(0).setPreferredWidth(30);//tem ent
       jt_inventariofisicodetalle.getColumnModel().getColumn(1).setPreferredWidth(80);//tem ent
       jt_inventariofisicodetalle.getColumnModel().getColumn(2).setPreferredWidth(150);//tem ent
       jt_inventariofisicodetalle.getColumnModel().getColumn(3).setPreferredWidth(40);//tem ent
       jt_inventariofisicodetalle.getColumnModel().getColumn(4).setPreferredWidth(50);//tem ent
       jt_inventariofisicodetalle.getColumnModel().getColumn(5).setPreferredWidth(80);//tem ent
       jt_inventariofisicodetalle.getColumnModel().getColumn(6).setPreferredWidth(60);//tem ent

       jt_catainventarios.getColumnModel().getColumn(0).setPreferredWidth(80);//tem ent
       jt_catainventarios.getColumnModel().getColumn(1).setPreferredWidth(150);//tem ent
       jt_catainventarios.getColumnModel().getColumn(2).setPreferredWidth(60);//tem ent
       jt_catainventarios.getColumnModel().getColumn(3).setPreferredWidth(60);//tem ent
       jt_catainventarios.getColumnModel().getColumn(4).setPreferredWidth(95);//tem ent
       jt_catainventarios.getColumnModel().getColumn(5).setPreferredWidth(95);//tem ent
       jt_catainventarios.getColumnModel().getColumn(6).setPreferredWidth(60);//tem ent
       jt_catainventarios.getColumnModel().getColumn(7).setPreferredWidth(60);//tem ent
       jt_catainventarios.getColumnModel().getColumn(8).setPreferredWidth(60);//tem ent

       jtb_catalogo_articulos.getColumnModel().getColumn(0).setPreferredWidth(60);//tem ent
       jtb_catalogo_articulos.getColumnModel().getColumn(1).setPreferredWidth(60);//familia
       jtb_catalogo_articulos.getColumnModel().getColumn(2).setPreferredWidth(60);//subfam.
       jtb_catalogo_articulos.getColumnModel().getColumn(3).setPreferredWidth(15);//id
       jtb_catalogo_articulos.getColumnModel().getColumn(4).setPreferredWidth(45);//clave
       jtb_catalogo_articulos.getColumnModel().getColumn(5).setPreferredWidth(80);//descrip.
       jtb_catalogo_articulos.getColumnModel().getColumn(6).setPreferredWidth(45);//item
       jtb_catalogo_articulos.getColumnModel().getColumn(7).setPreferredWidth(25);//precio
       jtb_catalogo_articulos.getColumnModel().getColumn(8).setPreferredWidth(25);//f.ult. compra
       jtb_catalogo_articulos.getColumnModel().getColumn(9).setPreferredWidth(25);//Observaciones
       jtb_catalogo_articulos.getTableHeader().setBackground(Color.yellow);


       jt_repsubfam.getColumnModel().getColumn(0).setPreferredWidth(120);//familia
       jt_repsubfam.getColumnModel().getColumn(1).setPreferredWidth(60);//subfam.
       jt_repsubfam.getColumnModel().getColumn(2).setPreferredWidth(60);//id
       jt_repsubfam.getColumnModel().getColumn(3).setPreferredWidth(60);//clave
       jt_repsubfam.getColumnModel().getColumn(4).setPreferredWidth(60);//descrip.
       jt_repsubfam.getColumnModel().getColumn(5).setPreferredWidth(60);//descrip.
       jt_repsubfam.getTableHeader().setBackground(Color.yellow);

       jt_repfamilia.getColumnModel().getColumn(0).setPreferredWidth(120);//familia
       jt_repfamilia.getColumnModel().getColumn(1).setPreferredWidth(60);//subfam.
       jt_repfamilia.getColumnModel().getColumn(2).setPreferredWidth(60);//id
       jt_repfamilia.getColumnModel().getColumn(3).setPreferredWidth(60);//clave
       jt_repfamilia.getColumnModel().getColumn(4).setPreferredWidth(60);//descrip.
       jt_repfamilia.getColumnModel().getColumn(5).setPreferredWidth(60);//descrip.
       jt_repfamilia.getTableHeader().setBackground(Color.yellow);

       jt_eninvefamilia.getColumnModel().getColumn(0).setPreferredWidth(40);//familia
       jt_eninvefamilia.getColumnModel().getColumn(1).setPreferredWidth(120);//subfam.

       jt_eninvesfamilia.getColumnModel().getColumn(0).setPreferredWidth(40);//familia
       jt_eninvesfamilia.getColumnModel().getColumn(1).setPreferredWidth(120);//subfam.

       jtb_catalogo_historialfisico.getColumnModel().getColumn(0).setPreferredWidth(30);//familia
       jtb_catalogo_historialfisico.getColumnModel().getColumn(1).setPreferredWidth(120);//subfam.
       jtb_catalogo_historialfisico.getColumnModel().getColumn(2).setPreferredWidth(60);//id
       jtb_catalogo_historialfisico.getColumnModel().getColumn(3).setPreferredWidth(30);//clave
       jtb_catalogo_historialfisico.getColumnModel().getColumn(4).setPreferredWidth(80);//descrip.
       jtb_catalogo_historialfisico.getColumnModel().getColumn(5).setPreferredWidth(80);//descrip.
       jtb_catalogo_historialfisico.getColumnModel().getColumn(6).setPreferredWidth(60);//clave
       jtb_catalogo_historialfisico.getColumnModel().getColumn(7).setPreferredWidth(90);//descrip.
       jtb_catalogo_historialfisico.getColumnModel().getColumn(8).setPreferredWidth(30);//descrip.
       jtb_catalogo_historialfisico.getTableHeader().setBackground(Color.yellow);

       this.setLocation(5,5);
       this.jtf_descripinventario.requestFocus();
    }


private void iniciar_modelo_de_tabla()
{
        jtable_modelo=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo.addColumn("<html><b>id</b></html>");
        jtable_modelo.addColumn("<html><b>Codigo</b></html>");
        jtable_modelo.addColumn("<html><b>Descripcion</b></html>");
        jtable_modelo.addColumn("<html><b>Precio</b></html>");
        jtable_modelo.addColumn("<html><b>C.Fisica</b></html>");
        jtable_modelo.addColumn("<html><b>Observaciones</b></html>");
        jtable_modelo.addColumn("<html><b>Foto</b></html>");
}

private void iniciar_modelo_catalogo()
    {

        jtable_modelo_catalogo=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_catalogo.addColumn("<html><b>Id/Status</b></html>");
        jtable_modelo_catalogo.addColumn("<html><b>Descripcion</b></html>");
        jtable_modelo_catalogo.addColumn("<html><b>F.Aplica</b></html>");
        jtable_modelo_catalogo.addColumn("<html><b>F.Revisa</b></html>");
        jtable_modelo_catalogo.addColumn("<html><b>Realizo</b></html>");
        jtable_modelo_catalogo.addColumn("<html><b>Confirmo</b></html>");
        jtable_modelo_catalogo.addColumn("<html><b>Piezas</b></html>");
        jtable_modelo_catalogo.addColumn("<html><b>Costo</b></html>");
        jtable_modelo_catalogo.addColumn("<html><b>Precio</b></html>");

     }

private void iniciar_modelo_diferencias()
    {

        jtable_modelo_diferencias=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_diferencias.addColumn("<html><b>Temp. Ent.</b></html>");
        jtable_modelo_diferencias.addColumn("<html><b>Familia</b></html>");
        jtable_modelo_diferencias.addColumn("<html><b>Sub_fam.</b></html>");
        jtable_modelo_diferencias.addColumn("<html><b>Id</b></html>");
        jtable_modelo_diferencias.addColumn("<html><b>Clave</b></html>");
        jtable_modelo_diferencias.addColumn("<html><b>Descripcion.</b></html>");
        jtable_modelo_diferencias.addColumn("<html><b>Item.</b></html>");
        jtable_modelo_diferencias.addColumn("<html><b>Costo</b></html>");
        jtable_modelo_diferencias.addColumn("<html><b>Precio</b></html>");
        jtable_modelo_diferencias.addColumn("<html><b>Teorica</b></html>");
        jtable_modelo_diferencias.addColumn("<html><b>Fisica</b></html>");
        jtable_modelo_diferencias.addColumn("<html><b>Diferencia</b></html>");

    }
private void iniciar_modelo_subfam()
    {

        jtable_modelo_subfam=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_subfam.addColumn("<html><b>sub Familia</b></html>");
        jtable_modelo_subfam.addColumn("<html><b>teorica.</b></html>");
        jtable_modelo_subfam.addColumn("<html><b>fisica</b></html>");
        jtable_modelo_subfam.addColumn("<html><b>dif</b></html>");
        jtable_modelo_subfam.addColumn("<html><b>costo Fis</b></html>");
        jtable_modelo_subfam.addColumn("<html><b>costo dif.</b></html>");

    }
 private void iniciar_modelo_familia()
    {

        jtable_modelo_familia=new javax.swing.table.DefaultTableModel();//Creo el modelo

        jtable_modelo_familia.addColumn("<html><b>Familia</b></html>");
        jtable_modelo_familia.addColumn("<html><b>teorica.</b></html>");
        jtable_modelo_familia.addColumn("<html><b>fisica</b></html>");
        jtable_modelo_familia.addColumn("<html><b>dif</b></html>");
        jtable_modelo_familia.addColumn("<html><b>costo Fis</b></html>");
        jtable_modelo_familia.addColumn("<html><b>costo dif.</b></html>");

    }
 private void iniciar_modelo_familiaeninventario()
    {
        jtable_modelo_familiaeninve=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_familiaeninve.addColumn("<html><b>Id</b></html>");
        jtable_modelo_familiaeninve.addColumn("<html><b>Familia</b></html>");
    }
 private void iniciar_modelo_subfameninve()
    {
        jtable_modelo_subfameninve=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_subfameninve.addColumn("<html><b>Id</b></html>");
        jtable_modelo_subfameninve.addColumn("<html><b>Sub Familia</b></html>");
    }
 private void iniciar_modelo_articuloseninve()
    {
        jtable_modelo_Articeninve=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_Articeninve.addColumn("<html><b>Temp. Ent.</b></html>");
        jtable_modelo_Articeninve.addColumn("<html><b>Familia</b></html>");
        jtable_modelo_Articeninve.addColumn("<html><b>Sub_fam.</b></html>");
        jtable_modelo_Articeninve.addColumn("<html><b>Id</b></html>");
        jtable_modelo_Articeninve.addColumn("<html><b>Clave</b></html>");
        jtable_modelo_Articeninve.addColumn("<html><b>Descripcion.</b></html>");
        jtable_modelo_Articeninve.addColumn("<html><b>Item.</b></html>");
    }
private void iniciar_modelo_articulofisicohistorial()
    {
        jtable_modelo_Artihistorifisico=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_Artihistorifisico.addColumn("<html><b>Folio.</b></html>");
        jtable_modelo_Artihistorifisico.addColumn("<html><b>Descripcion</b></html>");
        jtable_modelo_Artihistorifisico.addColumn("<html><b>Fecha.</b></html>");
        jtable_modelo_Artihistorifisico.addColumn("<html><b>Hora.</b></html>");
        jtable_modelo_Artihistorifisico.addColumn("<html><b>Realizo</b></html>");
        jtable_modelo_Artihistorifisico.addColumn("<html><b>superviso</b></html>");
        jtable_modelo_Artihistorifisico.addColumn("<html><b>Clave</b></html>");
        jtable_modelo_Artihistorifisico.addColumn("<html><b>Descripcion.</b></html>");
        jtable_modelo_Artihistorifisico.addColumn("<html><b>Cantidad</b></html>");
    }
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel1 = new javax.swing.JPanel();
        jPanel7 = new javax.swing.JPanel();
        jScrollPane2 = new javax.swing.JScrollPane();
        jt_catainventarios = new javax.swing.JTable()
        {
            public boolean isCellEditable(int rowIndex, int mColIndex) {
                return false;
            }
        }
        ;
        jPanel5 = new javax.swing.JPanel();
        jtf_idinve = new javax.swing.JTextField();
        jtf_tienda = new javax.swing.JTextField();
        jLabel14 = new javax.swing.JLabel();
        jtf_codelabora = new javax.swing.JTextField();
        jLabel15 = new javax.swing.JLabel();
        jtf_codconfirmaconteo = new javax.swing.JTextField();
        jLabel16 = new javax.swing.JLabel();
        jtf_descripinventario = new javax.swing.JTextField();
        jbtn_crearinvedetalle = new javax.swing.JButton();
        jLabel17 = new javax.swing.JLabel();
        jtf_horainicio = new javax.swing.JTextField();
        jLabel18 = new javax.swing.JLabel();
        jtf_fecha = new javax.swing.JTextField();
        jLabel19 = new javax.swing.JLabel();
        jtf_fecharevisa = new javax.swing.JTextField();
        jtf_idelabora = new javax.swing.JTextField();
        jtf_idconfirma = new javax.swing.JTextField();
        jPanel2 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jtf_codigo = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        jtf_cantidad = new javax.swing.JTextField();
        jLabel5 = new javax.swing.JLabel();
        jtf_folio = new javax.swing.JTextField();
        jLabel20 = new javax.swing.JLabel();
        jtf_codigoinve_observa = new javax.swing.JTextField();
        jPanel3 = new javax.swing.JPanel();
        jLabel6 = new javax.swing.JLabel();
        jtf_ultimocodigo = new javax.swing.JTextField();
        jLabel7 = new javax.swing.JLabel();
        jft_ultimodescripcion = new javax.swing.JTextField();
        jLabel8 = new javax.swing.JLabel();
        jtf_ultimoprecio = new javax.swing.JTextField();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jtf_canactual = new javax.swing.JTextField();
        jtf_cananterior = new javax.swing.JTextField();
        jScrollPane3 = new javax.swing.JScrollPane();
        jta_archivo = new javax.swing.JTextArea();
        jbtn_importar = new javax.swing.JButton();
        jPanel4 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jt_inventariofisicodetalle = new javax.swing.JTable()
        {
            public boolean isCellEditable(int rowIndex, int mColIndex) {
                return false;
            }
        }
        ;
        jLabel11 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        jtf_totalpiezas = new javax.swing.JTextField();
        jtf_totalarticulos = new javax.swing.JTextField();
        jbtn_cerrardocto = new javax.swing.JButton();
        jbtn_autorizarinventario = new javax.swing.JButton();
        jbtn_agregarainvecongelado = new javax.swing.JButton();
        jbtn_nuevo = new javax.swing.JButton();
        jbtn_cancelar = new javax.swing.JButton();
        jPanel6 = new javax.swing.JPanel();
        jPanel13 = new javax.swing.JPanel();
        jScrollPane7 = new javax.swing.JScrollPane();
        jt_eninvefamilia = new javax.swing.JTable()
        {
            public boolean isCellEditable(int rowIndex, int mColIndex) {
                return false;
            }
        }
        ;
        jPanel14 = new javax.swing.JPanel();
        jScrollPane8 = new javax.swing.JScrollPane();
        jt_eninvesfamilia = new javax.swing.JTable()
        {
            public boolean isCellEditable(int rowIndex, int mColIndex) {
                return false;
            }
        }
        ;
        jPanel15 = new javax.swing.JPanel();
        jScrollPane9 = new javax.swing.JScrollPane();
        jt_articuloseninve = new javax.swing.JTable()
        {
            public boolean isCellEditable(int rowIndex, int mColIndex) {
                return false;
            }
        }
        ;
        jButton1 = new javax.swing.JButton();
        jPanel8 = new javax.swing.JPanel();
        jPanel12 = new javax.swing.JPanel();
        jScrollPane6 = new javax.swing.JScrollPane();
        jt_repfamilia = new javax.swing.JTable()
        {
            public boolean isCellEditable(int rowIndex, int mColIndex) {
                return false;
            }
        }
        ;
        jPanel10 = new javax.swing.JPanel();
        jScrollPane4 = new javax.swing.JScrollPane();
        jt_repsubfam = new javax.swing.JTable()
        {
            public boolean isCellEditable(int rowIndex, int mColIndex) {
                return false;
            }
        }
        ;
        jPanel11 = new javax.swing.JPanel();
        jScrollPane5 = new javax.swing.JScrollPane();
        jtb_catalogo_articulos = new javax.swing.JTable()
        {
            public boolean isCellEditable(int rowIndex, int mColIndex) {
                return false;
            }
        }
        ;
        jScrollPane10 = new javax.swing.JScrollPane();
        jtb_catalogo_historialfisico = new javax.swing.JTable()
        {
            public boolean isCellEditable(int rowIndex, int mColIndex) {
                return false;
            }
        }
        ;
        jbtn_congelarexistencias = new javax.swing.JButton();
        jckbx_verdifgen = new javax.swing.JCheckBox();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        jmni_salir = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();
        jmni_quitarpieza = new javax.swing.JMenuItem();
        jmni_actualizar = new javax.swing.JMenuItem();
        jmni_escape = new javax.swing.JMenuItem();
        jMenu3 = new javax.swing.JMenu();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(sie_invdis.Sie_invdisApp.class).getContext().getResourceMap(com_distri_articulos_invefisico_detalle.class);
        setTitle(resourceMap.getString("Form.title")); // NOI18N
        setName("Form"); // NOI18N

        jTabbedPane1.setName("jTabbedPane1"); // NOI18N
        jTabbedPane1.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jTabbedPane1StateChanged(evt);
            }
        });

        jPanel1.setName("jPanel1"); // NOI18N

        jPanel7.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel7.border.title"))); // NOI18N
        jPanel7.setName("jPanel7"); // NOI18N

        jScrollPane2.setName("jScrollPane2"); // NOI18N

        jt_catainventarios.setModel(this.jtable_modelo_catalogo);
        jt_catainventarios.setName("jt_catainventarios"); // NOI18N
        jt_catainventarios.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jt_catainventariosMouseClicked(evt);
                if(evt.getClickCount() >= 2)
                {
                    dioclick(evt);
                    //System.out.println(" double click" );

                }
            }
        });
        jScrollPane2.setViewportView(jt_catainventarios);

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 960, Short.MAX_VALUE)
        );
        jPanel7Layout.setVerticalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 174, Short.MAX_VALUE)
        );

        jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel5.border.title"))); // NOI18N
        jPanel5.setName("jPanel5"); // NOI18N

        jtf_idinve.setEditable(false);
        jtf_idinve.setName("jtf_idinve"); // NOI18N

        jtf_tienda.setEditable(false);
        jtf_tienda.setName("jtf_tienda"); // NOI18N

        jLabel14.setText(resourceMap.getString("jLabel14.text")); // NOI18N
        jLabel14.setName("jLabel14"); // NOI18N

        jtf_codelabora.setToolTipText(resourceMap.getString("jtf_codelabora.toolTipText")); // NOI18N
        jtf_codelabora.setName("jtf_codelabora"); // NOI18N
        jtf_codelabora.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtf_codelaboraActionPerformed(evt);
            }
        });

        jLabel15.setText(resourceMap.getString("jLabel15.text")); // NOI18N
        jLabel15.setName("jLabel15"); // NOI18N

        jtf_codconfirmaconteo.setToolTipText(resourceMap.getString("jtf_codconfirmaconteo.toolTipText")); // NOI18N
        jtf_codconfirmaconteo.setName("jtf_codconfirmaconteo"); // NOI18N
        jtf_codconfirmaconteo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtf_codconfirmaconteoActionPerformed(evt);
            }
        });

        jLabel16.setText(resourceMap.getString("jLabel16.text")); // NOI18N
        jLabel16.setName("jLabel16"); // NOI18N

        jtf_descripinventario.setToolTipText(resourceMap.getString("jtf_descripinventario.toolTipText")); // NOI18N
        jtf_descripinventario.setName("jtf_descripinventario"); // NOI18N
        jtf_descripinventario.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtf_descripinventarioActionPerformed(evt);
            }
        });

        jbtn_crearinvedetalle.setText(resourceMap.getString("jbtn_crearinvedetalle.text")); // NOI18N
        jbtn_crearinvedetalle.setName("jbtn_crearinvedetalle"); // NOI18N
        jbtn_crearinvedetalle.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtn_crearinvedetalleActionPerformed(evt);
            }
        });

        jLabel17.setText(resourceMap.getString("jLabel17.text")); // NOI18N
        jLabel17.setName("jLabel17"); // NOI18N

        jtf_horainicio.setEditable(false);
        jtf_horainicio.setToolTipText(resourceMap.getString("jtf_horainicio.toolTipText")); // NOI18N
        jtf_horainicio.setName("jtf_horainicio"); // NOI18N

        jLabel18.setText(resourceMap.getString("jLabel18.text")); // NOI18N
        jLabel18.setName("jLabel18"); // NOI18N

        jtf_fecha.setEditable(false);
        jtf_fecha.setName("jtf_fecha"); // NOI18N

        jLabel19.setText(resourceMap.getString("jLabel19.text")); // NOI18N
        jLabel19.setName("jLabel19"); // NOI18N

        jtf_fecharevisa.setEditable(false);
        jtf_fecharevisa.setName("jtf_fecharevisa"); // NOI18N

        jtf_idelabora.setEditable(false);
        jtf_idelabora.setText(resourceMap.getString("jtf_idelabora.text")); // NOI18N
        jtf_idelabora.setName("jtf_idelabora"); // NOI18N

        jtf_idconfirma.setEditable(false);
        jtf_idconfirma.setText(resourceMap.getString("jtf_idconfirma.text")); // NOI18N
        jtf_idconfirma.setName("jtf_idconfirma"); // NOI18N

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel5Layout.createSequentialGroup()
                                .addContainerGap()
                                .addComponent(jLabel18)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jtf_fecha))
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel5Layout.createSequentialGroup()
                                .addComponent(jLabel19)
                                .addGap(28, 28, 28)
                                .addComponent(jtf_fecharevisa, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jbtn_crearinvedetalle)
                            .addGroup(jPanel5Layout.createSequentialGroup()
                                .addComponent(jLabel17)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jtf_horainicio, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(jtf_idconfirma, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE))))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel5Layout.createSequentialGroup()
                                .addComponent(jtf_idinve, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jtf_tienda, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel16)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jtf_descripinventario, javax.swing.GroupLayout.PREFERRED_SIZE, 183, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel5Layout.createSequentialGroup()
                                .addComponent(jLabel14)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jtf_codelabora, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jtf_idelabora, javax.swing.GroupLayout.DEFAULT_SIZE, 16, Short.MAX_VALUE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel15)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jtf_codconfirmaconteo, javax.swing.GroupLayout.PREFERRED_SIZE, 84, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGap(24, 24, 24)))
                .addContainerGap())
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jtf_descripinventario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jtf_idinve, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jtf_tienda, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel16))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jtf_codelabora, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel14)
                    .addComponent(jtf_idelabora, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jtf_codconfirmaconteo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel15))
                .addGap(13, 13, 13)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jtf_fecha, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel18)
                    .addComponent(jLabel17)
                    .addComponent(jtf_horainicio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jtf_idconfirma, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jtf_fecharevisa, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jbtn_crearinvedetalle)
                    .addComponent(jLabel19)))
        );

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel2.border.title"))); // NOI18N
        jPanel2.setName("jPanel2"); // NOI18N

        jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
        jLabel1.setName("jLabel1"); // NOI18N

        jtf_codigo.setToolTipText(resourceMap.getString("jtf_codigo.toolTipText")); // NOI18N
        jtf_codigo.setName("jtf_codigo"); // NOI18N
        jtf_codigo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtf_codigoActionPerformed(evt);
            }
        });

        jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N
        jLabel2.setName("jLabel2"); // NOI18N

        jtf_cantidad.setEditable(false);
        jtf_cantidad.setText(resourceMap.getString("jtf_cantidad.text")); // NOI18N
        jtf_cantidad.setName("jtf_cantidad"); // NOI18N

        jLabel5.setText(resourceMap.getString("jLabel5.text")); // NOI18N
        jLabel5.setName("jLabel5"); // NOI18N

        jtf_folio.setEditable(false);
        jtf_folio.setName("jtf_folio"); // NOI18N

        jLabel20.setText(resourceMap.getString("jLabel20.text")); // NOI18N
        jLabel20.setName("jLabel20"); // NOI18N

        jtf_codigoinve_observa.setToolTipText(resourceMap.getString("jtf_codigoinve_observa.toolTipText")); // NOI18N
        jtf_codigoinve_observa.setName("jtf_codigoinve_observa"); // NOI18N
        jtf_codigoinve_observa.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtf_codigoinve_observaActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGap(12, 12, 12)
                        .addComponent(jLabel5)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtf_folio, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel1)
                        .addGap(4, 4, 4)
                        .addComponent(jtf_codigo, javax.swing.GroupLayout.PREFERRED_SIZE, 128, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jLabel2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtf_cantidad, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel20)
                        .addGap(4, 4, 4)
                        .addComponent(jtf_codigoinve_observa, javax.swing.GroupLayout.DEFAULT_SIZE, 177, Short.MAX_VALUE)))
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jtf_codigo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel1)
                    .addComponent(jLabel5)
                    .addComponent(jtf_folio, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 15, Short.MAX_VALUE)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(jtf_cantidad, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel20)
                    .addComponent(jtf_codigoinve_observa, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel3.border.title"))); // NOI18N
        jPanel3.setName("jPanel3"); // NOI18N

        jLabel6.setText(resourceMap.getString("jLabel6.text")); // NOI18N
        jLabel6.setName("jLabel6"); // NOI18N

        jtf_ultimocodigo.setEditable(false);
        jtf_ultimocodigo.setFont(resourceMap.getFont("jtf_ultimocodigo.font")); // NOI18N
        jtf_ultimocodigo.setName("jtf_ultimocodigo"); // NOI18N

        jLabel7.setText(resourceMap.getString("jLabel7.text")); // NOI18N
        jLabel7.setName("jLabel7"); // NOI18N

        jft_ultimodescripcion.setEditable(false);
        jft_ultimodescripcion.setFont(resourceMap.getFont("jft_ultimodescripcion.font")); // NOI18N
        jft_ultimodescripcion.setName("jft_ultimodescripcion"); // NOI18N

        jLabel8.setText(resourceMap.getString("jLabel8.text")); // NOI18N
        jLabel8.setName("jLabel8"); // NOI18N

        jtf_ultimoprecio.setEditable(false);
        jtf_ultimoprecio.setFont(resourceMap.getFont("jtf_ultimoprecio.font")); // NOI18N
        jtf_ultimoprecio.setName("jtf_ultimoprecio"); // NOI18N

        jLabel9.setText(resourceMap.getString("jLabel9.text")); // NOI18N
        jLabel9.setName("jLabel9"); // NOI18N

        jLabel10.setText(resourceMap.getString("jLabel10.text")); // NOI18N
        jLabel10.setName("jLabel10"); // NOI18N

        jtf_canactual.setEditable(false);
        jtf_canactual.setFont(resourceMap.getFont("jtf_canactual.font")); // NOI18N
        jtf_canactual.setName("jtf_canactual"); // NOI18N

        jtf_cananterior.setEditable(false);
        jtf_cananterior.setFont(resourceMap.getFont("jtf_cananterior.font")); // NOI18N
        jtf_cananterior.setName("jtf_cananterior"); // NOI18N

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel3Layout.createSequentialGroup()
                        .addComponent(jLabel9)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtf_canactual, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel10)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtf_cananterior, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel3Layout.createSequentialGroup()
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel7)
                            .addComponent(jLabel6))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                .addComponent(jtf_ultimocodigo, javax.swing.GroupLayout.PREFERRED_SIZE, 133, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel8)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jtf_ultimoprecio, javax.swing.GroupLayout.DEFAULT_SIZE, 77, Short.MAX_VALUE))
                            .addComponent(jft_ultimodescripcion, javax.swing.GroupLayout.DEFAULT_SIZE, 251, Short.MAX_VALUE))))
                .addContainerGap())
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jtf_ultimocodigo, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel6)
                    .addComponent(jtf_ultimoprecio, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel8))
                .addGap(20, 20, 20)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jft_ultimodescripcion, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel7))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel9)
                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jtf_canactual, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jtf_cananterior, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel10))))
        );

        jScrollPane3.setName("jScrollPane3"); // NOI18N

        jta_archivo.setColumns(20);
        jta_archivo.setRows(5);
        jta_archivo.setName("jta_archivo"); // NOI18N
        jScrollPane3.setViewportView(jta_archivo);

        jbtn_importar.setIcon(resourceMap.getIcon("jbtn_importar.icon")); // NOI18N
        jbtn_importar.setText(resourceMap.getString("jbtn_importar.text")); // NOI18N
        jbtn_importar.setName("jbtn_importar"); // NOI18N
        jbtn_importar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtn_importarActionPerformed(evt);
            }
        });

        jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel4.border.title"))); // NOI18N
        jPanel4.setName("jPanel4"); // NOI18N

        jScrollPane1.setName("jScrollPane1"); // NOI18N

        jt_inventariofisicodetalle.setModel(this.jtable_modelo);
        jt_inventariofisicodetalle.setName("jt_inventariofisicodetalle"); // NOI18N
        jt_inventariofisicodetalle.setRowHeight(26);
        jScrollPane1.setViewportView(jt_inventariofisicodetalle);

        jLabel11.setText(resourceMap.getString("jLabel11.text")); // NOI18N
        jLabel11.setName("jLabel11"); // NOI18N

        jLabel12.setText(resourceMap.getString("jLabel12.text")); // NOI18N
        jLabel12.setName("jLabel12"); // NOI18N

        jtf_totalpiezas.setEditable(false);
        jtf_totalpiezas.setFont(resourceMap.getFont("jtf_totalpiezas.font")); // NOI18N
        jtf_totalpiezas.setText(resourceMap.getString("jtf_totalpiezas.text")); // NOI18N
        jtf_totalpiezas.setName("jtf_totalpiezas"); // NOI18N

        jtf_totalarticulos.setEditable(false);
        jtf_totalarticulos.setFont(resourceMap.getFont("jtf_totalarticulos.font")); // NOI18N
        jtf_totalarticulos.setText(resourceMap.getString("jtf_totalarticulos.text")); // NOI18N
        jtf_totalarticulos.setName("jtf_totalarticulos"); // NOI18N

        jbtn_cerrardocto.setIcon(resourceMap.getIcon("jbtn_cerrardocto.icon")); // NOI18N
        jbtn_cerrardocto.setText(resourceMap.getString("jbtn_cerrardocto.text")); // NOI18N
        jbtn_cerrardocto.setToolTipText(resourceMap.getString("jbtn_cerrardocto.toolTipText")); // NOI18N
        jbtn_cerrardocto.setName("jbtn_cerrardocto"); // NOI18N
        jbtn_cerrardocto.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtn_cerrardoctoActionPerformed(evt);
            }
        });

        jbtn_autorizarinventario.setIcon(resourceMap.getIcon("jbtn_autorizarinventario.icon")); // NOI18N
        jbtn_autorizarinventario.setText(resourceMap.getString("jbtn_autorizarinventario.text")); // NOI18N
        jbtn_autorizarinventario.setToolTipText(resourceMap.getString("jbtn_autorizarinventario.toolTipText")); // NOI18N
        jbtn_autorizarinventario.setName("jbtn_autorizarinventario"); // NOI18N
        jbtn_autorizarinventario.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtn_autorizarinventarioActionPerformed(evt);
            }
        });

        jbtn_agregarainvecongelado.setIcon(resourceMap.getIcon("jbtn_agregarainvecongelado.icon")); // NOI18N
        jbtn_agregarainvecongelado.setText(resourceMap.getString("jbtn_agregarainvecongelado.text")); // NOI18N
        jbtn_agregarainvecongelado.setToolTipText(resourceMap.getString("jbtn_agregarainvecongelado.toolTipText")); // NOI18N
        jbtn_agregarainvecongelado.setName("jbtn_agregarainvecongelado"); // NOI18N
        jbtn_agregarainvecongelado.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtn_agregarainvecongeladoActionPerformed(evt);
            }
        });

        jbtn_nuevo.setText(resourceMap.getString("jbtn_nuevo.text")); // NOI18N
        jbtn_nuevo.setToolTipText(resourceMap.getString("jbtn_nuevo.toolTipText")); // NOI18N
        jbtn_nuevo.setName("jbtn_nuevo"); // NOI18N
        jbtn_nuevo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtn_nuevoActionPerformed(evt);
            }
        });

        jbtn_cancelar.setIcon(resourceMap.getIcon("jbtn_cancelar.icon")); // NOI18N
        jbtn_cancelar.setText(resourceMap.getString("jbtn_cancelar.text")); // NOI18N
        jbtn_cancelar.setName("jbtn_cancelar"); // NOI18N
        jbtn_cancelar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtn_cancelarActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 620, Short.MAX_VALUE)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jLabel11)
                        .addGap(2, 2, 2)
                        .addComponent(jtf_totalarticulos, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel12)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jtf_totalpiezas, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jbtn_nuevo))
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(jbtn_autorizarinventario)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jbtn_cerrardocto)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jbtn_agregarainvecongelado)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jbtn_cancelar)))
                .addContainerGap())
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 330, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel12)
                    .addComponent(jtf_totalpiezas, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jtf_totalarticulos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jbtn_nuevo)
                    .addComponent(jLabel11))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jbtn_autorizarinventario)
                    .addComponent(jbtn_cerrardocto)
                    .addComponent(jbtn_agregarainvecongelado)
                    .addComponent(jbtn_cancelar))
                .addGap(33, 33, 33))
        );

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, 320, Short.MAX_VALUE)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 212, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jbtn_importar))
                            .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jScrollPane3, 0, 0, Short.MAX_VALUE)
                            .addComponent(jbtn_importar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addGap(14, 14, 14))
                    .addComponent(jPanel4, 0, 432, Short.MAX_VALUE))
                .addGap(28, 28, 28))
        );

        jTabbedPane1.addTab(resourceMap.getString("jPanel1.TabConstraints.tabTitle"), jPanel1); // NOI18N

        jPanel6.setName("jPanel6"); // NOI18N

        jPanel13.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel13.border.title"))); // NOI18N
        jPanel13.setName("jPanel13"); // NOI18N

        jScrollPane7.setName("jScrollPane7"); // NOI18N

        jt_eninvefamilia.setModel(this.jtable_modelo_familiaeninve);
        jt_eninvefamilia.setName("jt_eninvefamilia"); // NOI18N
        jt_eninvefamilia.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jt_eninvefamiliaMouseClicked(evt);
                if(evt.getClickCount() >= 2)
                {
                    diodblclickverfameninve(evt);
                    //System.out.println(" double click" );
                }
            }
        });
        jScrollPane7.setViewportView(jt_eninvefamilia);

        javax.swing.GroupLayout jPanel13Layout = new javax.swing.GroupLayout(jPanel13);
        jPanel13.setLayout(jPanel13Layout);
        jPanel13Layout.setHorizontalGroup(
            jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane7, javax.swing.GroupLayout.DEFAULT_SIZE, 338, Short.MAX_VALUE)
        );
        jPanel13Layout.setVerticalGroup(
            jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, 146, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        jPanel14.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel14.border.title"))); // NOI18N
        jPanel14.setName("jPanel14"); // NOI18N

        jScrollPane8.setName("jScrollPane8"); // NOI18N

        jt_eninvesfamilia.setModel(this.jtable_modelo_subfameninve);
        jt_eninvesfamilia.setName("jt_eninvesfamilia"); // NOI18N
        jt_eninvesfamilia.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jt_eninvesfamiliaMouseClicked(evt);
                if(evt.getClickCount() >= 2)
                {
                    diodblclickvsaeninve(evt);
                    //System.out.println(" double click" );

                }
            }
        });
        jScrollPane8.setViewportView(jt_eninvesfamilia);

        javax.swing.GroupLayout jPanel14Layout = new javax.swing.GroupLayout(jPanel14);
        jPanel14.setLayout(jPanel14Layout);
        jPanel14Layout.setHorizontalGroup(
            jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane8, javax.swing.GroupLayout.DEFAULT_SIZE, 338, Short.MAX_VALUE)
        );
        jPanel14Layout.setVerticalGroup(
            jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane8, javax.swing.GroupLayout.PREFERRED_SIZE, 146, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        jPanel15.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel15.border.title"))); // NOI18N
        jPanel15.setName("jPanel15"); // NOI18N

        jScrollPane9.setName("jScrollPane9"); // NOI18N

        jt_articuloseninve.setModel(this.jtable_modelo_Articeninve);
        jt_articuloseninve.setName("jt_articuloseninve"); // NOI18N
        jt_repfamilia.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jt_repfamiliaMouseClicked(evt);
                if(evt.getClickCount() >= 2)
                {
                    diodblclickfam(evt);
                    //System.out.println(" double click" );

                }
            }
        });
        jScrollPane9.setViewportView(jt_articuloseninve);

        javax.swing.GroupLayout jPanel15Layout = new javax.swing.GroupLayout(jPanel15);
        jPanel15.setLayout(jPanel15Layout);
        jPanel15Layout.setHorizontalGroup(
            jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane9, javax.swing.GroupLayout.DEFAULT_SIZE, 960, Short.MAX_VALUE)
        );
        jPanel15Layout.setVerticalGroup(
            jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane9, javax.swing.GroupLayout.PREFERRED_SIZE, 337, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        jButton1.setIcon(resourceMap.getIcon("jButton1.icon")); // NOI18N
        jButton1.setText(resourceMap.getString("jButton1.text")); // NOI18N
        jButton1.setToolTipText(resourceMap.getString("jButton1.toolTipText")); // NOI18N
        jButton1.setName("jButton1"); // NOI18N
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel6Layout.createSequentialGroup()
                        .addComponent(jPanel13, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel6Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jButton1))
                    .addComponent(jPanel15, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel6Layout.createSequentialGroup()
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jPanel14, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel13, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel15, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 17, Short.MAX_VALUE)
                .addComponent(jButton1)
                .addGap(52, 52, 52))
        );

        jTabbedPane1.addTab(resourceMap.getString("jPanel6.TabConstraints.tabTitle"), jPanel6); // NOI18N

        jPanel8.setName("jPanel8"); // NOI18N

        jPanel12.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel12.border.title"))); // NOI18N
        jPanel12.setName("jPanel12"); // NOI18N

        jScrollPane6.setName("jScrollPane6"); // NOI18N

        jt_repfamilia.setModel(this.jtable_modelo_familia);
        jt_repfamilia.setName("jt_repfamilia"); // NOI18N
        jt_repfamilia.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jt_repfamiliaMouseClicked(evt);
                if(evt.getClickCount() >= 2)
                {
                    diodblclickfam(evt);
                    //System.out.println(" double click" );

                }
            }
        });
        jScrollPane6.setViewportView(jt_repfamilia);

        javax.swing.GroupLayout jPanel12Layout = new javax.swing.GroupLayout(jPanel12);
        jPanel12.setLayout(jPanel12Layout);
        jPanel12Layout.setHorizontalGroup(
            jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane6, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 496, Short.MAX_VALUE)
        );
        jPanel12Layout.setVerticalGroup(
            jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, 178, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        jPanel10.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel10.border.title"))); // NOI18N
        jPanel10.setName("jPanel10"); // NOI18N

        jScrollPane4.setName("jScrollPane4"); // NOI18N

        jt_repsubfam.setModel(this.jtable_modelo_subfam);
        jt_repsubfam.setName("jt_repsubfam"); // NOI18N
        jt_repsubfam.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jt_repsubfamMouseClicked(evt);
                if(evt.getClickCount() >= 2)
                {
                    diodblclick(evt);
                    //System.out.println(" double click" );

                }
            }
        });
        jScrollPane4.setViewportView(jt_repsubfam);

        javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10);
        jPanel10.setLayout(jPanel10Layout);
        jPanel10Layout.setHorizontalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane4, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 412, Short.MAX_VALUE)
        );
        jPanel10Layout.setVerticalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 180, Short.MAX_VALUE)
        );

        jPanel11.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel11.border.title"))); // NOI18N
        jPanel11.setName("jPanel11"); // NOI18N

        jScrollPane5.setName("jScrollPane5"); // NOI18N

        jtb_catalogo_articulos.setModel(this.jtable_modelo_diferencias);
        jtb_catalogo_articulos.setName("jtb_catalogo_articulos"); // NOI18N
        jtb_catalogo_articulos.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jtb_catalogo_articulosMouseClicked(evt);
                if(evt.getClickCount() >= 2)
                {
                    dioclickidarti(evt);
                    //System.out.println(" double click" );

                }
            }
        });
        jScrollPane5.setViewportView(jtb_catalogo_articulos);

        jScrollPane10.setName("jScrollPane10"); // NOI18N

        jtb_catalogo_historialfisico.setModel(this.jtable_modelo_Artihistorifisico);
        jtb_catalogo_historialfisico.setName("jtb_catalogo_historialfisico"); // NOI18N
        jScrollPane10.setViewportView(jtb_catalogo_historialfisico);

        javax.swing.GroupLayout jPanel11Layout = new javax.swing.GroupLayout(jPanel11);
        jPanel11.setLayout(jPanel11Layout);
        jPanel11Layout.setHorizontalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 960, Short.MAX_VALUE)
            .addComponent(jScrollPane10, javax.swing.GroupLayout.DEFAULT_SIZE, 960, Short.MAX_VALUE)
        );
        jPanel11Layout.setVerticalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel11Layout.createSequentialGroup()
                .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 257, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane10, javax.swing.GroupLayout.PREFERRED_SIZE, 82, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        jbtn_congelarexistencias.setText(resourceMap.getString("jbtn_congelarexistencias.text")); // NOI18N
        jbtn_congelarexistencias.setToolTipText(resourceMap.getString("jbtn_congelarexistencias.toolTipText")); // NOI18N
        jbtn_congelarexistencias.setName("jbtn_congelarexistencias"); // NOI18N
        jbtn_congelarexistencias.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtn_congelarexistenciasActionPerformed(evt);
            }
        });

        jckbx_verdifgen.setText(resourceMap.getString("jckbx_verdifgen.text")); // NOI18N
        jckbx_verdifgen.setName("jckbx_verdifgen"); // NOI18N
        jckbx_verdifgen.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jckbx_verdifgenActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
        jPanel8.setLayout(jPanel8Layout);
        jPanel8Layout.setHorizontalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addComponent(jPanel12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(40, 40, 40))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel8Layout.createSequentialGroup()
                .addComponent(jPanel11, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jbtn_congelarexistencias)
                .addGap(51, 51, 51)
                .addComponent(jckbx_verdifgen)
                .addContainerGap(551, Short.MAX_VALUE))
        );
        jPanel8Layout.setVerticalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jPanel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jbtn_congelarexistencias)
                    .addComponent(jckbx_verdifgen))
                .addContainerGap(12, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab(resourceMap.getString("jPanel8.TabConstraints.tabTitle"), jPanel8); // NOI18N

        jMenuBar1.setName("jMenuBar1"); // NOI18N

        jMenu1.setText(resourceMap.getString("jMenu1.text")); // NOI18N
        jMenu1.setName("jMenu1"); // NOI18N

        jmni_salir.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.ALT_MASK));
        jmni_salir.setIcon(resourceMap.getIcon("jmni_salir.icon")); // NOI18N
        jmni_salir.setText(resourceMap.getString("jmni_salir.text")); // NOI18N
        jmni_salir.setName("jmni_salir"); // NOI18N
        jmni_salir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmni_salirActionPerformed(evt);
            }
        });
        jMenu1.add(jmni_salir);

        jMenuBar1.add(jMenu1);

        jMenu2.setText(resourceMap.getString("jMenu2.text")); // NOI18N
        jMenu2.setName("jMenu2"); // NOI18N

        jmni_quitarpieza.setText(resourceMap.getString("jmni_quitarpieza.text")); // NOI18N
        jmni_quitarpieza.setName("jmni_quitarpieza"); // NOI18N
        jmni_quitarpieza.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmni_quitarpiezaActionPerformed(evt);
            }
        });
        jMenu2.add(jmni_quitarpieza);

        jmni_actualizar.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F5, 0));
        jmni_actualizar.setIcon(resourceMap.getIcon("jmni_actualizar.icon")); // NOI18N
        jmni_actualizar.setText(resourceMap.getString("jmni_actualizar.text")); // NOI18N
        jmni_actualizar.setName("jmni_actualizar"); // NOI18N
        jmni_actualizar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmni_actualizarActionPerformed(evt);
            }
        });
        jMenu2.add(jmni_actualizar);

        jmni_escape.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_ESCAPE, 0));
        jmni_escape.setText(resourceMap.getString("jmni_escape.text")); // NOI18N
        jmni_escape.setName("jmni_escape"); // NOI18N
        jmni_escape.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmni_escapeActionPerformed(evt);
            }
        });
        jMenu2.add(jmni_escape);

        jMenuBar1.add(jMenu2);

        jMenu3.setText(resourceMap.getString("jMenu3.text")); // NOI18N
        jMenu3.setName("jMenu3"); // NOI18N
        jMenuBar1.add(jMenu3);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 991, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 671, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jmni_salirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_salirActionPerformed
        // TODO add your handling code here:
       if(JOptionPane.showConfirmDialog(null, "Realmente Desea Salir?")==0)
        {
            this.dispose();
        }
    }//GEN-LAST:event_jmni_salirActionPerformed

    private void jtf_codelaboraActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_codelaboraActionPerformed
        // TODO add your handling code here:
        this.carga_datos_emprealiza(this.jtf_codelabora.getText().trim());
}//GEN-LAST:event_jtf_codelaboraActionPerformed

    private void jtf_codconfirmaconteoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_codconfirmaconteoActionPerformed
        // TODO add your handling code here:
        this.carga_datos_empsupervisa(this.jtf_codconfirmaconteo.getText().trim());
}//GEN-LAST:event_jtf_codconfirmaconteoActionPerformed

    private void jtf_descripinventarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_descripinventarioActionPerformed
        // TODO add your handling code here:
        this.jtf_codelabora.requestFocus();
}//GEN-LAST:event_jtf_descripinventarioActionPerformed

    private void jbtn_crearinvedetalleActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_crearinvedetalleActionPerformed
        // TODO add your handling code here:

        if ((Integer.valueOf(this.jtf_idelabora.getText().toString()) > 0) && (Integer.valueOf(this.jtf_idconfirma.getText().toString()) > 0)&& (this.jtf_descripinventario.getText().length() > 0)) {
            if(JOptionPane.showConfirmDialog(null, "Desea Crear Inventario?")==0) {
                this.creainventario(ffoliopadre,Integer.valueOf(this.jtf_idelabora.getText()),Integer.valueOf(this.jtf_idconfirma.getText()),this.jtf_descripinventario.getText().toUpperCase(),"");
            }
        } else {
            JOptionPane.showMessageDialog(null,"Verifique, descripcion, Id emplado elabora e Id Empleado supervisa", "Sistema Integral(Inventarios: Alta) : Ayuda",1);
            this.jtf_descripinventario.requestFocus();
        }

    }//GEN-LAST:event_jbtn_crearinvedetalleActionPerformed

    private void jtf_codigoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_codigoActionPerformed
        // TODO add your handling code here:
        String arreglocantidad[]=null;
        if ((this.jtf_codigo.getText().length() > 0) && (this.jtf_folio.getText().length() > 0)) {
            String cadenacodigo=this.jtf_codigo.getText().replace("*",":");
            arreglocantidad=cadenacodigo.split(":");
            if (arreglocantidad.length==2) {
                this.jtf_cantidad.setText(arreglocantidad[0]);
                this.jtf_codigo.setText(arreglocantidad[1]);
            }
            this.creainventario_adddetalle(Integer.valueOf(this.jtf_folio.getText()),this.jtf_codigo.getText().toUpperCase().trim(),Float.valueOf(this.jtf_cantidad.getText().trim()),this.jtf_codigoinve_observa.getText().toUpperCase().trim());
            this.jtf_cantidad.setText("1");
            this.contararticulos();
        }
}//GEN-LAST:event_jtf_codigoActionPerformed

    private void jtf_codigoinve_observaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_codigoinve_observaActionPerformed
        // TODO add your handling code here:
        this.jtf_codigo.requestFocus();
}//GEN-LAST:event_jtf_codigoinve_observaActionPerformed

    private void jbtn_importarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_importarActionPerformed
        // TODO add your handling code here:
        if(JOptionPane.showConfirmDialog(null, "Desea Importar Datos?")==0) {


            String arreglo_importa[]=this.jta_archivo.getText().split("\n");
            String arreglo_codigo[]=null;
            System.out.println("Estos tiene archivo:"+arreglo_importa.length);
            for (int i=0;i<arreglo_importa.length;i++) {

                arreglo_codigo=arreglo_importa[i].split("\t");
                this.jtf_cantidad.setText(arreglo_codigo[1]);
                this.jtf_codigo.setText(arreglo_codigo[0]);
                this.jtf_codigoActionPerformed(evt);
            }
        }
}//GEN-LAST:event_jbtn_importarActionPerformed

    private void jbtn_cerrardoctoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_cerrardoctoActionPerformed
        // TODO add your handling code here:
        if(JOptionPane.showConfirmDialog(null, "Desea Cerrar este Domcumento?")==0) {
            this.creainventario_actualiza(Integer.valueOf(this.jtf_folio.getText()),1,"");
            if (variables_global.getnivelusu()<3) {
                this.jbtn_autorizarinventario.setVisible(true);
            }
        }
}//GEN-LAST:event_jbtn_cerrardoctoActionPerformed

    private void jbtn_autorizarinventarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_autorizarinventarioActionPerformed
        // TODO add your handling code here:
        if(JOptionPane.showConfirmDialog(null, "Autorizar Inventario?")==0) {
            this.creainventario_actualiza(Integer.valueOf(this.jtf_folio.getText()),2,"");
            if (variables_global.getnivelusu()<3) {
                this.jbtn_agregarainvecongelado.setVisible(true);
            }
        }
}//GEN-LAST:event_jbtn_autorizarinventarioActionPerformed

    private void jbtn_agregarainvecongeladoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_agregarainvecongeladoActionPerformed
        // TODO add your handling code here:
        if(JOptionPane.showConfirmDialog(null, "Desea Integrar Inventario a Inventario Congelado?")==0) {
            this.creainventario_aplicar(ffoliopadre,Integer.valueOf(this.jtf_folio.getText()));
            this.jbtn_agregarainvecongelado.setVisible(false);
        }
}//GEN-LAST:event_jbtn_agregarainvecongeladoActionPerformed

    private void jbtn_nuevoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_nuevoActionPerformed
        // TODO add your handling code here:
        this.LimpiarJTabledetalle();
        this.jtf_descripinventario.setText("");
        this.jtf_codelabora.setText("");
        this.jtf_codconfirmaconteo.setText("");
        this.jtf_idconfirma.setText("");
        this.jtf_idelabora.setText("");
        this.jtf_folio.setText("");
        this.jbtn_crearinvedetalle.setVisible(false);
        this.jtf_descripinventario.requestFocus();
        this.jtf_ultimoprecio.setText("");
        this.jtf_ultimocodigo.setText("");
        this.jft_ultimodescripcion.setText("");
        this.jtf_totalpiezas.setText("");
        this.jtf_totalarticulos.setText("");
        this.jbtn_crearinvedetalle.setVisible(true);
    }//GEN-LAST:event_jbtn_nuevoActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        // TODO add your handling code here:
        this.carga_datos_vermisarticulos(0, ffoliopadre);
}//GEN-LAST:event_jButton1ActionPerformed

    private void jbtn_congelarexistenciasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_congelarexistenciasActionPerformed
        // TODO add your handling code here:
       if(JOptionPane.showConfirmDialog(null, "Desea Congelar Existencias?")==0) {
            this.congelar_existencias(ffoliopadre);
        }
}//GEN-LAST:event_jbtn_congelarexistenciasActionPerformed

    private void jmni_escapeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_escapeActionPerformed
        // TODO add your handling code here:
        this.jmni_salirActionPerformed(evt);
    }//GEN-LAST:event_jmni_escapeActionPerformed

    private void jmni_actualizarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_actualizarActionPerformed
        // TODO add your handling code here:
        
           this.carga_datos_catalogo( ffoliopadre,0,"");
    }//GEN-LAST:event_jmni_actualizarActionPerformed

    private void jmni_quitarpiezaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_quitarpiezaActionPerformed
        // TODO add your handling code here:
         String quitaarticulo=JOptionPane.showInputDialog("Ingresa codigo que Deseas Quitar una pieza:");
         this.jtf_codigo.setText(quitaarticulo);
         this.jtf_cantidad.setText("-1");
         this.jtf_codigoActionPerformed(evt);
         this.jtf_cantidad.setText("1");
    }//GEN-LAST:event_jmni_quitarpiezaActionPerformed

    private void jTabbedPane1StateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jTabbedPane1StateChanged
        // TODO add your handling code here:
        indexactual=this.jTabbedPane1.getSelectedIndex();
        if((indexactual==1)&&(yacargue1==0))
            {
               yacargue1=1;
                this.carga_datos_verfameninve(3, ffoliopadre, "");
            }
        if( (indexactual==2) && (yacargue2==0) )
            {
               yacargue2=1;
                this.carga_datos_reportediffamilia(1,ffoliopadre, "");
            }
    }//GEN-LAST:event_jTabbedPane1StateChanged

    private void jbtn_cancelarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_cancelarActionPerformed
        // TODO add your handling code here:
         if(JOptionPane.showConfirmDialog(null, "Desea Cancelar Este Documento?")==0) {
            this.creainventario_actualiza(Integer.valueOf(this.jtf_folio.getText()),3,"");
             this.jbtn_autorizarinventario.setVisible(false);
             this.jbtn_cerrardocto.setVisible(false);
             this.jbtn_agregarainvecongelado.setVisible(false);
        }
    }//GEN-LAST:event_jbtn_cancelarActionPerformed

    private void jckbx_verdifgenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jckbx_verdifgenActionPerformed
        // TODO add your handling code here:
        if(JOptionPane.showConfirmDialog(null, "Desea Cancelar Este Documento?")==0) {
            this.carga_datos_reportediferencias(ffoliopadre,5,"");
        }
        

    }//GEN-LAST:event_jckbx_verdifgenActionPerformed

    private void contararticulos()
    {
    int filas =this.jtable_modelo.getRowCount();
    this.jtf_totalarticulos.setText(String.valueOf(filas));
    }


private void carga_datos_catalogo(int idfoliopadre,int opcion,String textbusqueda)
    {
        String fechacat = "",fechallegatienda="",fechaentrega="";
         DecimalFormat miformat = new DecimalFormat("###,###,###,###");
       this.LimpiarJTablecat();
       Object[] fnewRow = new Object[9];
       float totalpiezas=0,totalcosto=0,totalprecio=0;
       //invoco al metodo que trae el recordset de datos
       rs = x.sieuno_executediversosv2("select * from x1distribucion_terminados_inven_det_catalogo("+idfoliopadre+","+opcion+",'"+textbusqueda+"') as (id integer,idpadre integer,fechaaplica date,horaaplica text,fecharevisa date,horarevisa text,idempleelabora integer,idempleasuper integer,idsupervision integer,cantidadarticulo numeric,descripinve text,observa text,idstatusconge smallint,cantfisica numeric,importecosto numeric,importeprecio numeric,nombreelabora text,nombresupervisa text,nombreopera text,descripinvepadre text,fechaprogra date,descripstatus character varying(40),statuspadre smallint);",variables_global.getconexiongral());
        try
         {
            while (rs.next())
                {
                fnewRow[0]=rs.getString ("id")+":"+rs.getString ("descripstatus");
                fnewRow[1]=rs.getString ("descripinve");
                fnewRow[2]="<html>"+this.fechaeuropea(rs.getString ("fechaaplica"))+":<br>"+DiaSemana(this.fechaeuropea(rs.getString ("fechaaplica")))+" "+rs.getString ("fechaaplica")+"</html>";
                 if(rs.getString("fecharevisa") != null)
                        {
                           fechallegatienda="<html>"+ rs.getString("fecharevisa")+":<br>"+DiaSemana(rs.getString ("fecharevisa"))+" "+rs.getString ("fecharevisa")+"</html>";
                        }
                 fnewRow[3]=fechallegatienda;
                 fnewRow[4]=rs.getString ("idempleelabora")+":"+rs.getString ("nombreelabora");
                 fnewRow[5]=rs.getString("idempleasuper")+":"+rs.getString ("nombresupervisa");
                 fnewRow[6]=miformat.format(rs.getFloat("cantfisica"));
                 if (variables_global.getnivelusu()<3)
                 {
                    fnewRow[7]=miformat.format(rs.getFloat("importecosto"));
                 }
                 else
                 {
                    fnewRow[7]="0";
                 }

                 fnewRow[8]=miformat.format(rs.getFloat("importeprecio"));
                 totalpiezas+=rs.getFloat("cantfisica");
                 totalcosto+=rs.getFloat("importecosto");
                 totalprecio+=rs.getFloat("importeprecio");
                 jtable_modelo_catalogo.addRow(fnewRow);

                }

        }
        catch(Exception e)
        {
            System.out.println(e.getMessage());
        }
       if (variables_global.getnivelusu()<3)
        {
                fnewRow[0]="";
                fnewRow[1]="";
                fnewRow[2]="";
                fnewRow[3]="";
                fnewRow[4]="";
                fnewRow[5]="Totales:";
                fnewRow[6]=miformat.format(totalpiezas);
                fnewRow[7]=miformat.format(totalcosto);
                fnewRow[8]=miformat.format(totalprecio);
                jtable_modelo_catalogo.addRow(fnewRow);
         }
        this.cambiartamanofilascat();
      }

private void carga_datos_emprealiza(String codigo)
    {
       //invoco al metodo que trae el recordset de datos
    int encontro=0;
    String realiza="",idrealiza="";
       rs = x.sieuno_executediversosv2("select * from x1sieuno_articulo_inven_det_aplicadoresv2('"+codigo+"') as (id integer,nom character varying(50),pat character varying(50));",variables_global.getconexiongral());
        try
         {
            while (rs.next())
                {
                    encontro=1;
                    idrealiza=rs.getString("id");
                    realiza=rs.getString("nom")+" "+rs.getString("pat");
                }

        }
        catch(Exception e)
        {
            System.out.println(e.getMessage());
        }
       if (encontro==1)
              {
                  if(JOptionPane.showConfirmDialog(null, "Realiza:"+realiza+" Esta Correcto?")==0)
                        {
                            this.jtf_idelabora.setText(idrealiza);
                            this.jtf_codelabora.setText(realiza);
                            this.jtf_codconfirmaconteo.requestFocus();
                            encontro=0;
                        }
                  else
                        {
                            this.jtf_codelabora.requestFocus();
                            this.jtf_codelabora.setText("");
                            encontro=0;
                        }
              }
       else
           {
               this.jtf_codelabora.requestFocus();
               this.jtf_codelabora.setText("");
               JOptionPane.showMessageDialog(null,"Error No existe el Empleado", "Sistema Integral(Inventarios: Alta) : Ayuda",1);
               encontro=0;
           }
      }
private void carga_datos_empsupervisa(String codigo)
    {
       //invoco al metodo que trae el recordset de datos
    int encontro=0;
    String realiza="",idrealiza="";
       rs = x.sieuno_executediversosv2("select * from x1sieuno_articulo_inven_det_aplicadoresv2('"+codigo+"') as (id integer,nom character varying(50),pat character varying(50));",variables_global.getconexiongral());
        try
         {
            while (rs.next())
                {
                    encontro=1;
                    idrealiza=rs.getString("id");
                    realiza=rs.getString("nom")+" "+rs.getString("pat");
                }

        }
        catch(Exception e)
        {
            System.out.println(e.getMessage());
        }
       if (encontro==1)
              {
                  if(JOptionPane.showConfirmDialog(null, "Supervisa:"+realiza+" Esta Correcto?")==0)
                        {
                            this.jtf_idconfirma.setText(idrealiza);
                            this.jtf_codconfirmaconteo.setText(realiza);
                            encontro=0;
                            this.jbtn_crearinvedetalle.requestFocus();
                        }
                  else
                        {
                            this.jtf_codconfirmaconteo.requestFocus();
                            this.jtf_codconfirmaconteo.setText("");
                            encontro=0;
                        }
              }
       else
           {
               this.jtf_codconfirmaconteo.requestFocus();
               this.jtf_codconfirmaconteo.setText("");
               JOptionPane.showMessageDialog(null,"Error No existe el Empleado", "Sistema Integral(Inventarios: Alta) : Ayuda",1);
               encontro=0;
           }
      }
private void creainventario(int idpadre,int idelabora,int idsupervisa,String describe,String observa)
    {
       //invoco al metodo que trae el recordset de datos
    int folio=0;
        try
         {
            rs = x.sieuno_executediversosv2("select * from x1distribucion_terminados_inven_detalle_insert("+idpadre+","+idelabora+","+idsupervisa+",'"+describe+"','"+observa+"');",variables_global.getconexiongral());
            while (rs.next())
                {
                       folio=rs.getInt(1);
                }

        }
        catch(Exception e)
        {
            System.out.println(e.getMessage());
        }
       if (folio>0)
              {
                  JOptionPane.showMessageDialog(null,"Folio:"+folio+" Creado Correctamento","Sistema Integral(Inventarios: Alta) : Ayuda",1);

                            this.jtf_folio.setText(String.valueOf(folio));
                            this.jtf_codigo.requestFocus();
                            this.LimpiarJTabledetalle();
                            this.jtf_totalarticulos.setText("0");
                            this.jtf_totalpiezas.setText("0");

              }
       else
           {
               JOptionPane.showMessageDialog(null,"Error Folio no Creado Consulte a su ADMINISTRADOR", "Sistema Integral(Inventarios: Alta) : Ayuda",1);

           }
     }

private void creainventario_adddetalle(int inve,String codigoenvia,float cantidad,String observacodigo)
    {
       //invoco al metodo que trae el recordset de datos
    int encontrado=0;

    rs = x.sieuno_executediversosv2("select * from x1distribucion_terminados_inven_detalle_art_insert("+inve+",'"+codigoenvia+"',"+cantidad+",'"+observacodigo+"') as (claveproducto character varying(16),descrip character varying(80),costo numeric,precio numeric);",variables_global.getconexiongral());
        try
         {
            while (rs.next())
                {
                       encontrado=1;

                       this.creainventario_adddetalle_tabla(".",rs.getString("claveproducto"),rs.getString("descrip"),rs.getString("precio"),String.valueOf(cantidad),observacodigo);
                }

        }
        catch(Exception e)
        {
            System.out.println(e.getMessage());
        }
       if (encontrado==1)
              {
                   this.jtf_codigo.setText("");
                   this.jtf_codigo.requestFocus();

              }
       else
           {
               JOptionPane.showMessageDialog(null,"Error Clave:"+codigoenvia+" No existe!", "Sistema Integral(Inventarios: Alta) : Ayuda",1);

           }
     }
private void creainventario_actualiza(int inve,int opcion,String observadocto)
    {
       //invoco al metodo que trae el recordset de datos
    int encontrado=0;
    rs = x.sieuno_executediversosv2("select * from x1distribucion_terminados_inven_det_actualiza("+inve+","+opcion+",'"+observadocto+"');",variables_global.getconexiongral());
        try
         {
            while (rs.next())
                {
                     encontrado=rs.getInt(1);
                }
        }
        catch(Exception e)
        {
            System.out.println(e.getMessage());
        }
       if (encontrado==1)
              {
               JOptionPane.showMessageDialog(null,"Gracias!", "Sistema Integral(Inventarios: Alta) : Ayuda",1);

              }
       else
           {
               JOptionPane.showMessageDialog(null,"Error Documento no Actualizado!", "Sistema Integral(Inventarios: Alta) : Ayuda",1);
           }
     }

private void creainventario_aplicar(int invepadre,int idinvehijo)
    {
       //invoco al metodo que trae el recordset de datos
    int encontrado=0;
    String textosql="select * from x1distribucion_terminados_inven_congelar_addfis("+invepadre+","+idinvehijo+");";
    System.out.println(textosql);
        try
         {
            rs = x.sieuno_executediversosv2(textosql,variables_global.getconexiongral());
            while (rs.next())
                {
                     encontrado=rs.getInt(1);
                }

        }
        catch(Exception e)
        {
            System.out.println(e.getMessage());
        }
       if (encontrado==1)
              {
               JOptionPane.showMessageDialog(null,"Gracias Documento Integrado", "Sistema Integral(Inventarios: Alta) : Ayuda",1);
              }
       else
           {
               JOptionPane.showMessageDialog(null,"Error Documento no Actualizado!", "Sistema Integral(Inventarios: Alta) : Ayuda",1);
           }
     }

private void creainventario_adddetalle_tabla(String id,String codigo,String descripcion,String precio,String cantidad,String observa)
{
   int numeroarticulos=this.jtable_modelo.getRowCount();
   String codigoactual="";
   float cantidadanterior=0,cantidadactual=0,totalpiezasf=0;
   int encontrado=0;
    Object[] fnewRow = new Object[7];
       //invoco al metodo que trae el recordset de datos
    for(int ii=0;ii<numeroarticulos;ii++)
                {
                    codigoactual=jtable_modelo.getValueAt(ii, 1).toString();
                    if (codigo.equals(codigoactual))
                        {
                            encontrado=1;
                            cantidadanterior=Float.valueOf(jtable_modelo.getValueAt(ii, 4).toString());
                            cantidadactual=cantidadanterior+Float.valueOf(cantidad);
                            jtable_modelo.setValueAt(cantidadactual,ii ,4);
                            jtable_modelo.setValueAt(observa,ii ,5);
                            totalpiezasf=Float.valueOf(this.jtf_totalpiezas.getText().replace(",",""))+Float.valueOf(cantidad);
                            this.jtf_totalpiezas.setText(String.valueOf(totalpiezasf));
                        }
                }
       if(encontrado==0)
            {
                fnewRow[0]=id;
                fnewRow[1]=codigo;
                fnewRow[2]=descripcion;
                fnewRow[3]=precio;
                fnewRow[4]=cantidad;
                fnewRow[5]=observa;
                fnewRow[6]="";
                totalpiezasf=Float.valueOf(this.jtf_totalpiezas.getText().replace(",",""))+Float.valueOf(cantidad);
                this.jtf_totalpiezas.setText(String.valueOf(totalpiezasf));
                jtable_modelo.addRow(fnewRow);
                cantidadactual=Float.valueOf(cantidad);
            }
       this.jtf_ultimocodigo.setText(codigo);
       this.jtf_ultimoprecio.setText(precio);
       this.jft_ultimodescripcion.setText(descripcion);
       this.jtf_cananterior.setText(String.valueOf(cantidadanterior));
       this.jtf_canactual.setText(String.valueOf(cantidadactual));
}

private String  fechaeuropea(String fecha) {

         //resibe cadena de fecha en formato americano yyyy-MM-dd
        java.util.Date fechaestaeuropa=null;
       SimpleDateFormat formateadorestaeuropa = new SimpleDateFormat("dd-MM-yyyy");
       String cadenafecha="";
        try
         {
          fechaestaeuropa = formateadoresta.parse(fecha);
         }
        catch (ParseException e)
          {
             //Error, la cadena de texto no se puede convertir en fecha.
          }
       cadenafecha= formateadorestaeuropa.format(fechaestaeuropa);
       return cadenafecha;

    }
private String DiaSemana(String fe) {
         String dia = "";
       java.util.Date fecha=null;
         try
            {
             fecha = formateador.parse(fe);

           }
        catch (ParseException e)
            {
            //Error, la cadena de texto no se puede convertir en fecha.
            }
        Calendar cal= Calendar.getInstance();
        cal.setTime(fecha);
        //ojo para establecer o recetear cada parte de la fecha por separado
        //cal.set(Calendar.YEAR, fecha.getYear());
        //cal.set(Calendar.MONTH, fecha.getMonth());
        //cal.set(Calendar.DAY_OF_MONTH, fecha.getDay());
        int diaInt = cal.get(Calendar.DAY_OF_WEEK);
        switch (diaInt) {
            case 1:
                dia = "Domingo";
                break;
            case 2:
                dia = "Lunes";
                break;
            case 3:
                dia = "Martes";
                break;
            case 4:
                dia = "Miercoles";
                break;
            case 5:
                dia = "Jueves";
                break;
            case 6:
                dia = "Viernes";
                break;
            case 7:
                dia = "Sabado";
                break;

        }
        return dia;
    }

private void LimpiarJTablecat()
 {
     //limpiar la tabla
    while(jtable_modelo_catalogo.getRowCount()>0)jtable_modelo_catalogo.removeRow(0);
 }
private void LimpiarJTabledetalle()
 {
     //limpiar la tabla
    while(this.jtable_modelo.getRowCount()>0)this.jtable_modelo.removeRow(0);
 }
private void cambiartamanofilascat()
 {
     //limpiar la tabla


       int numerofilas=this.jtable_modelo_catalogo.getRowCount();

             for(int i = 0 ;i < numerofilas; i++)
                {
                     this.jt_catainventarios.setRowHeight(i, 30);
                }
  }

private void congelar_existencias(int inventario)
    {
       //invoco al metodo que trae el recordset de datos
    int resultado=0;
       rs = x.sieuno_executediversosv2("select * from x1distribucion_terminados_inven_congelarv2("+inventario+");",variables_global.getconexiongral());
        try
        {
            while (rs.next())
                {
                    resultado=rs.getInt(1);
                }
        }
        catch(Exception e)
            {
                System.out.println(e.getMessage());
            }
       if (resultado==1)
            {
                  JOptionPane.showMessageDialog(null,"Gracias Inventario congelado","Sistema Integral(Inventarios: Alta) : Ayuda",1);
            }
       if (resultado==2)
            {
                  JOptionPane.showMessageDialog(null,"Error Inventario ya esta Congelado","Sistema Integral(Inventarios: Alta) : Ayuda",1);
            }
}

private void carga_datos_detalleinve(int idfoliopadre,int opcion,String textbusqueda)
{
          DecimalFormat miformat = new DecimalFormat("###,###,###,###");
          this.jtf_codigo.setEditable(true);
          this.jtf_codigoinve_observa.setEditable(true);
          this.jbtn_cerrardocto.setVisible(true);
          this.jbtn_autorizarinventario.setVisible(false);
          this.jbtn_agregarainvecongelado.setVisible(false);
       //invoco al metodo que trae el recordset de datos

        try
            {
            rs = x.sieuno_executediversosv2("select * from x1distribucion_terminados_inven_det_catalogo("+idfoliopadre+","+opcion+",'"+textbusqueda+"') as (id integer,idpadre integer,fechaaplica date,horaaplica text,fecharevisa date,horarevisa text,idempleelabora integer,idempleasuper integer,idsupervision integer,cantidadarticulo numeric,descripinve text,observa text,idstatusconge smallint,cantfisica numeric,importecosto numeric,importeprecio numeric,nombreelabora text,nombresupervisa text,nombreopera text,descripinvepadre text,fechaprogra date,descripstatus character varying(40),statuspadre smallint);",variables_global.getconexiongral());
            while (rs.next())
                {
                this.jtf_folio.setText(rs.getString ("id"));
                this.jtf_descripinventario.setText(rs.getString ("descripinve"));
                this.jtf_codelabora.setText(rs.getString ("nombreelabora"));
                this.jtf_codconfirmaconteo.setText(rs.getString ("nombresupervisa"));
                this.jtf_totalpiezas.setText(miformat.format(rs.getFloat("cantfisica")));
                if(rs.getInt("idstatusconge")>2)
                    {
                        this.jtf_codigo.setEditable(false);
                        this.jtf_codigoinve_observa.setEditable(false);

                        this.jbtn_cerrardocto.setVisible(false);
                    }
                if (variables_global.getnivelusu()<3)
                    {
                       if(rs.getInt("idstatusconge")==4)
                            {
                                this.jbtn_autorizarinventario.setVisible(true);
                            }
                       if(rs.getInt("idstatusconge")==5)
                            {
                                this.jbtn_agregarainvecongelado.setVisible(true);
                            }
                        if(rs.getInt("idstatusconge")<6)
                            {
                                this.jbtn_cancelar.setVisible(true);
                            }

                    }
                }
            }
        catch(Exception e)
            {
                System.out.println(e.getMessage());
            }
       //voy por el detalle del documento
       this. LimpiarJTabledetalle();
       Object[] fnewRow = new Object[7];

        try
         {
            rs = x.sieuno_executediversosv2("select * from x1distribucion_terminados_inven_det_detalle(0,"+Integer.valueOf(textbusqueda)+") as (id integer,idpadre integer,clavearticulo character varying(16),cantfisica numeric,observacion text,costo numeric,precioventa numeric,importecosto numeric,importeprecio numeric,descripcion character varying(80),familia character varying(5),subfam character varying(12),tementrada smallint,item character varying(20),precio1actual numeric,nobrefamilia character varying(40),nombrefamilia character varying(60));",variables_global.getconexiongral());
            while (rs.next())
                {
                        fnewRow[0]=".";
                        fnewRow[1]=rs.getString("clavearticulo");
                        fnewRow[2]=rs.getString("descripcion");
                        fnewRow[3]=rs.getString("precioventa");
                        fnewRow[4]=rs.getString("cantfisica");
                        fnewRow[5]=rs.getString("observacion");;
                        fnewRow[6]="";
                        jtable_modelo.addRow(fnewRow);
                }
        }
        catch(Exception e)
        {
            System.out.println(e.getMessage());
        }


}

private void carga_datos_vermisarticulos(int idtienda,int idfoliopadre)
    {
       this. LimpiarJTabledetalle();
       Object[] fnewRow = new Object[7];

       rs = x.sieuno_executediversosv2("select * from x1sieuno_articulo_inven_congelar_reportdiferencias("+idtienda+","+idfoliopadre+",0,'') as (iddet integer,idfisico integer,clave character varying(16),cantteo numeric,cantfis numeric,observa text,costo numeric,precio numeric,impcostofis numeric,importpreciofis numeric,importcosteo numeric,importprecioteo numeric,cantdif numeric,costodif numeric,preciodif numeric,descripcion character varying(80),familia integer,subfam integer,fechaulti date,tementrada character varying(25),item character varying(80),precio1 numeric,nombrefamilia character varying(30),nombresubfamilia character varying(50),idproducto integer);",variables_global.getconexiongral());

        try
         {
            while (rs.next())
                {
                        fnewRow[0]=rs.getString("idproducto");
                        fnewRow[1]=rs.getString("clave");
                        fnewRow[2]=rs.getString("descripcion");
                        fnewRow[3]=rs.getString("precio");
                        fnewRow[4]="";
                        fnewRow[5]="";
                        fnewRow[6]="";
                        jtable_modelo.addRow(fnewRow);
                }
        }
        catch(Exception e)
        {
            System.out.println(e.getMessage());
        }
    }

private void carga_datos_reportediferencias(int idfoliopadre,int opcion,String textbusqueda)
    {
       DecimalFormat miformat = new DecimalFormat("###,###,###,###");
       String htmlabre="<html><BODY>",htmlcierra="</BODY></html>",colorabre="",colorcierra="";
       //invoco al metodo que trae el recordset de datos
       while(jtable_modelo_diferencias.getRowCount()>0)jtable_modelo_diferencias.removeRow(0);
       //voy por el detalle del documento
       float colexis=0;
       Object[] fnewRow = new Object[12];
       String texto="select * from x1distribucion_terminados_inven_congelar_reportdiferencias("+idfoliopadre+","+opcion+",'"+textbusqueda+"') as (iddet integer,idfisico integer,clave character varying(16),cantteo numeric,cantfis numeric,observa text,costo numeric,precio numeric,impcostofis numeric,importpreciofis numeric,importcosteo numeric,importprecioteo numeric,cantdif numeric,costodif numeric,preciodif numeric,descripcion character varying(80),familia character varying(5),subfam character varying(12),fechaulti date,tementrada character varying(40),item character varying(20),precio1 numeric,nombrefamilia character varying(40),nombresubfamilia character varying(60));";
       System.out.println(texto);
        try
        {
            rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
            while (rs.next())
                {
                        fnewRow[0]=rs.getString("tementrada");
                        fnewRow[1]=rs.getString("nombrefamilia");
                        fnewRow[2]=rs.getString("nombresubfamilia");
                        fnewRow[3]=".";
                        fnewRow[4]=rs.getString("clave");
                        fnewRow[5]=rs.getString("descripcion");
                        fnewRow[6]=rs.getString("item");
                        fnewRow[7]=rs.getString("costo");
                        fnewRow[8]=rs.getString("precio");
                        fnewRow[9]=rs.getString("cantteo");
                        fnewRow[10]=rs.getString("cantfis");
                        colexis=rs.getFloat("cantdif");
                        colorabre="";
                        colorcierra="";
                        if (colexis<0)
                                {
                                    colorabre="<b><font color=#CC0000>";
                                    colorcierra="<font></b>";
                                }
                        if (colexis>0)
                                {
                                    colorabre="<b><font color=\"YELLOW\">";
                                    colorcierra="<font></b>";
                                }
                        fnewRow[11]=htmlabre+colorabre+rs.getFloat("cantdif")+colorcierra+htmlcierra;
                        jtable_modelo_diferencias.addRow(fnewRow);
              }
        }
        catch(Exception e)
            {
                System.out.println(e.getMessage());
            }
}
private void carga_datos_reportediffamilia(int opcion,int idfoliopadre,String busqueda)
    {
       DecimalFormat miformat = new DecimalFormat("###,###,###,###");
       //invoco al metodo que trae el recordset de datos
       while(jtable_modelo_familia.getRowCount()>0)jtable_modelo_familia.removeRow(0);
       //voy por el detalle del documento
       float cteo=0,cfis=0,cdif=0,costofis=0,costodif=0;
       Object[] fnewRow = new Object[6];
        try
         {
            rs = x.sieuno_executediversosv2("select * from x1distribucion_terminados_inven_congelar_reportdiferencia("+opcion+","+idfoliopadre+",'"+busqueda+"') as (idpadre integer,idfam character varying(5),nombrefam character varying(40),cantteo numeric,cantfis numeric,importecosfis numeric,importeprefis numeric,importecosteo numeric,importepreteo numeric,cantidaddif numeric,costodif numeric,preciodif numeric);",variables_global.getconexiongral());
            while (rs.next())
                {
                        fnewRow[0]=rs.getString("idfam")+":"+rs.getString("nombrefam");
                        fnewRow[1]=miformat.format(rs.getFloat("cantteo"));
                        fnewRow[2]=miformat.format(rs.getFloat("cantfis"));
                        fnewRow[3]=miformat.format(rs.getFloat("cantidaddif"));
                        fnewRow[4]=miformat.format(rs.getFloat("importecosfis"));
                        fnewRow[5]=miformat.format(rs.getFloat("costodif"));
                        cteo+=rs.getFloat("cantteo");
                        cfis+=rs.getFloat("cantfis");
                        cdif+=rs.getFloat("cantidaddif");
                        costofis+=rs.getFloat("importecosfis");
                        costodif+=rs.getFloat("costodif");
                        jtable_modelo_familia.addRow(fnewRow);
                }
                        fnewRow[0]="Totales";
                        fnewRow[1]=miformat.format(cteo);
                        fnewRow[2]=miformat.format(cfis);
                        fnewRow[3]=miformat.format(cdif);
                        fnewRow[4]=miformat.format(costofis);
                        fnewRow[5]=miformat.format(costodif);
                        jtable_modelo_familia.addRow(fnewRow);
        }
        catch(Exception e)
        {
            System.out.println(e.getMessage());
        }
      }
private void carga_datos_reportedifxsub(int opcion,int idfoliopadre,String busqueda)
    {

         DecimalFormat miformat = new DecimalFormat("###,###,###,###");
         float cteo=0,cfis=0,cdif=0,costofis=0,costodif=0;
       //invoco al metodo que trae el recordset de datos
        while(jtable_modelo_subfam.getRowCount()>0)jtable_modelo_subfam.removeRow(0);
       //voy por el detalle del documento
       Object[] fnewRow = new Object[6];

        try
         {
            rs = x.sieuno_executediversosv2("select * from x1distribucion_terminados_inven_congelar_reportdiferencia("+opcion+","+idfoliopadre+",'"+busqueda+"') as (idpadre integer,idfam character varying(5),subfam character varying(12),nombresubfam character varying(60),cantteo numeric,cantfis numeric,importecosfis numeric,importeprefis numeric,importecosteo numeric,importepreteo numeric,cantidaddif numeric,costodif numeric,preciodif numeric);",variables_global.getconexiongral());
            while (rs.next())
                {

                        fnewRow[0]=rs.getString("subfam")+":"+rs.getString("nombresubfam");
                        fnewRow[1]=miformat.format(rs.getFloat("cantteo"));
                        fnewRow[2]=miformat.format(rs.getFloat("cantfis"));
                        fnewRow[3]=miformat.format(rs.getFloat("cantidaddif"));
                        fnewRow[4]=miformat.format(rs.getFloat("importecosfis"));
                        fnewRow[5]=miformat.format(rs.getFloat("costodif"));
                        cteo+=rs.getFloat("cantteo");
                        cfis+=rs.getFloat("cantfis");
                        cdif+=rs.getFloat("cantidaddif");
                        costofis+=rs.getFloat("importecosfis");
                        costodif+=rs.getFloat("costodif");
                        jtable_modelo_subfam.addRow(fnewRow);
                }
             fnewRow[0]="Totales";
             fnewRow[1]=miformat.format(cteo);
             fnewRow[2]=miformat.format(cfis);
             fnewRow[3]=miformat.format(cdif);
             fnewRow[4]=miformat.format(costofis);
             fnewRow[5]=miformat.format(costodif);
             jtable_modelo_subfam.addRow(fnewRow);
        }
        catch(Exception e)
        {
            System.out.println(e.getMessage());
        }


      }
private void carga_datos_verfameninve(int opcion,int idfoliopadre,String busqueda)
    {
       //invoco al metodo que trae el recordset de datos
       while(jtable_modelo_familiaeninve.getRowCount()>0)jtable_modelo_familiaeninve.removeRow(0);
       //voy por el detalle del documento

       Object[] fnewRow = new Object[2];
        try
         {
            rs = x.sieuno_executediversosv2("select * from x1distribucion_terminados_inven_congelar_reportdiferencia("+opcion+","+idfoliopadre+",'"+busqueda+"') as (idfam character varying(5),nombrefam character varying(40));",variables_global.getconexiongral());
            while (rs.next())
                {
                        fnewRow[0]=rs.getString("idfam");
                        fnewRow[1]=rs.getString("nombrefam");
                        jtable_modelo_familiaeninve.addRow(fnewRow);
                }
        }
        catch(Exception e)
        {
            System.out.println(e.getMessage());
        }
      }
private void carga_datos_versubfameninve(int opcion,int idfoliopadre,String busqueda)
    {
       while(jtable_modelo_subfameninve.getRowCount()>0)jtable_modelo_subfameninve.removeRow(0);
       //voy por el detalle del documento
       Object[] fnewRow = new Object[2];
        try
         {
          rs = x.sieuno_executediversosv2("select * from x1distribucion_terminados_inven_congelar_reportdiferencia("+opcion+","+idfoliopadre+",'"+busqueda+"') as (idsubfam character varying(5),nombresubfam character varying(60));",variables_global.getconexiongral());
            while (rs.next())
                {
                        fnewRow[0]=rs.getString("idsubfam");
                        fnewRow[1]=rs.getString("nombresubfam");
                        jtable_modelo_subfameninve.addRow(fnewRow);
                }
        }
        catch(Exception e)
        {
            System.out.println(e.getMessage());
        }
      }
private void carga_datos_verarticuloseninve(int idfoliopadre,int opcion,String textbusqueda)
    {
       DecimalFormat miformat = new DecimalFormat("###,###,###,###");
       String htmlabre="<html><BODY>",htmlcierra="</BODY></html>",colorabre="",colorcierra="";
       //invoco al metodo que trae el recordset de datos
       while(jtable_modelo_Articeninve.getRowCount()>0)jtable_modelo_Articeninve.removeRow(0);
       //voy por el detalle del documento
       Object[] fnewRow = new Object[7];
       String texto="select * from x1distribucion_terminados_inven_congelar_reportdiferencias("+idfoliopadre+","+opcion+",'"+textbusqueda+"') as (iddet integer,idfisico integer,clave character varying(16),cantteo numeric,cantfis numeric,observa text,costo numeric,precio numeric,impcostofis numeric,importpreciofis numeric,importcosteo numeric,importprecioteo numeric,cantdif numeric,costodif numeric,preciodif numeric,descripcion character varying(80),familia character varying(5),subfam character varying(12),fechaulti date,tementrada character varying(40),item character varying(20),precio1 numeric,nombrefamilia character varying(40),nombresubfamilia character varying(60));";
       System.out.println(texto);
        try
        {
            rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
            while (rs.next())
                {
                        fnewRow[0]=rs.getString("tementrada");
                        fnewRow[1]=rs.getString("nombrefamilia");
                        fnewRow[2]=rs.getString("nombresubfamilia");
                        fnewRow[3]=".";
                        fnewRow[4]=rs.getString("clave");
                        fnewRow[5]=rs.getString("descripcion");
                        fnewRow[6]=rs.getString("item");
                        jtable_modelo_Articeninve.addRow(fnewRow);
              }
        }
        catch(Exception e)
         {
            System.out.println(e.getMessage());
        }


      }

private void carga_datos_verarticuloseninve_histori(int idfoliopadre,int opcion,String textbusqueda)
    {
       DecimalFormat miformat = new DecimalFormat("###,###,###,###");
       String htmlabre="<html><BODY>",htmlcierra="</BODY></html>",colorabre="",colorcierra="";
       //invoco al metodo que trae el recordset de datos
       while(jtable_modelo_Artihistorifisico.getRowCount()>0)jtable_modelo_Artihistorifisico.removeRow(0);
       //voy por el detalle del documento
       Object[] fnewRow = new Object[9];
       String texto="select * from x1distribucion_terminados_inven_det_detalle("+opcion+","+idfoliopadre+",'"+textbusqueda+"','') as (id integer,idpadre integer,clavearticulo character varying(16),cantfisica numeric,observacion text,costo numeric,precioventa numeric,importecosto numeric,importeprecio numeric,descripcion character varying(80),familia character varying(5),subfam character varying(12),tementrada smallint,item character varying(20),precio1actual numeric,nobrefamilia character varying(40),nombrefamilia character varying(60),idinvefisico integer,fechaaplicacion date,horaaplica text,idelbora integer,idsupervisa integer,describeinve text,observaciones text,idstatusconge smallint,nombreelabora text,nombresupervisa text,describestatus character varying(40),idstatuspadre smallint);";
       System.out.println(texto);
       try
        {
            rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
            while (rs.next())
                {
                        fnewRow[0]=rs.getString("idpadre");
                        fnewRow[1]=rs.getString("describeinve");
                        fnewRow[2]=this.fechaeuropea(rs.getString("fechaaplicacion"))+" "+this.DiaSemana(rs.getString("fechaaplicacion")).substring(0,3);
                        fnewRow[3]=rs.getString("horaaplica");
                        fnewRow[4]=rs.getString("idelbora")+":"+rs.getString("nombreelabora");
                        fnewRow[5]=rs.getString("idsupervisa")+":"+rs.getString("nombresupervisa");
                        fnewRow[6]=rs.getString("clavearticulo");
                        fnewRow[7]=rs.getString("descripcion");
                        fnewRow[8]=rs.getString("cantfisica");
                        jtable_modelo_Artihistorifisico.addRow(fnewRow);
                }
        }
        catch(Exception e)
        {
            System.out.println(e.getMessage());
        }
      }

private void diodblclickfam(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
            System.out.println("dio doble  click");
            int fila = jt_repfamilia.getSelectedRow();
            String idcadena[]=this.jt_repfamilia.getValueAt(fila, 0).toString().split(":");
            this.carga_datos_reportedifxsub(2, ffoliopadre, idcadena[0]);
    }
private void diodblclick(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
            System.out.println("dio doble  click en subfamilia");
            int fila = jt_repsubfam.getSelectedRow();
            String idcadena[]=this.jt_repsubfam.getValueAt(fila, 0).toString().split(":");
            this.carga_datos_reportediferencias(ffoliopadre,2,idcadena[0]);
    }

   private void dioclickidarti(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
         System.out.println("dio doble  click");
         int fila = jtb_catalogo_articulos.getSelectedRow(),folio=0;
         String idcadena = jtb_catalogo_articulos.getValueAt(fila, 4).toString();
    if(JOptionPane.showConfirmDialog(null, "Desea ver Articulo?")==0)
        {
        try
            {
                    rs = x.sieuno_executediversosv2("select * from x1distribucion_terminados_codigo_buscasidsieuno('"+idcadena+"') as (idarticulo integer);",variables_global.getconexiongral());
                    while (rs.next())
                        {
                            folio=rs.getInt(1);
                            articulos_sie_editar fase=new articulos_sie_editar(String.valueOf(folio));
                            fase.pack();
                            fase.setVisible(true);
    
                        }
            }
        catch(Exception e)
            {
                System.out.println(e.getMessage());
            }

        }
         idcadena = jtb_catalogo_articulos.getValueAt(fila, 4).toString();
         this.carga_datos_verarticuloseninve_histori(ffoliopadre,1,idcadena);
    }
   private void diodblclickverfameninve(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
            System.out.println("dio doble  click");
            int fila = jt_eninvefamilia.getSelectedRow();
            String idcadena=this.jt_eninvefamilia.getValueAt(fila, 0).toString();
            this.carga_datos_versubfameninve(4,ffoliopadre, idcadena);
    }
   private void diodblclickvsaeninve(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
            System.out.println("dio doble  click en subfamilia");
            int fila = jt_eninvesfamilia.getSelectedRow();
            String idcadena=this.jt_eninvesfamilia.getValueAt(fila, 0).toString();

            this.carga_datos_verarticuloseninve(ffoliopadre, 2, idcadena);
    }
private void dioclick(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
            System.out.println("dio doble  click");
            int fila = jt_catainventarios.getSelectedRow();
            String idcadena[]=this.jt_catainventarios.getValueAt(fila, 0).toString().split(":");
            this.carga_datos_detalleinve(ffoliopadre,1,idcadena[0]);
            this.jbtn_crearinvedetalle.setVisible(false);
            this.jtf_codigo.requestFocus();
            this.contararticulos();
    }

private void jtb_catalogo_articulosMouseClicked(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
    }

 private void jt_repsubfamMouseClicked(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
    }
    private void jt_eninvefamiliaMouseClicked(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
    }
    private void jt_eninvesfamiliaMouseClicked(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
    }
private void jt_repfamiliaMouseClicked(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
    }
private void jt_catainventariosMouseClicked(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
    }
    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new com_distri_articulos_invefisico_detalle().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenu jMenu3;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel10;
    private javax.swing.JPanel jPanel11;
    private javax.swing.JPanel jPanel12;
    private javax.swing.JPanel jPanel13;
    private javax.swing.JPanel jPanel14;
    private javax.swing.JPanel jPanel15;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane10;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JScrollPane jScrollPane7;
    private javax.swing.JScrollPane jScrollPane8;
    private javax.swing.JScrollPane jScrollPane9;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JButton jbtn_agregarainvecongelado;
    private javax.swing.JButton jbtn_autorizarinventario;
    private javax.swing.JButton jbtn_cancelar;
    private javax.swing.JButton jbtn_cerrardocto;
    private javax.swing.JButton jbtn_congelarexistencias;
    private javax.swing.JButton jbtn_crearinvedetalle;
    private javax.swing.JButton jbtn_importar;
    private javax.swing.JButton jbtn_nuevo;
    private javax.swing.JCheckBox jckbx_verdifgen;
    private javax.swing.JTextField jft_ultimodescripcion;
    private javax.swing.JMenuItem jmni_actualizar;
    private javax.swing.JMenuItem jmni_escape;
    private javax.swing.JMenuItem jmni_quitarpieza;
    private javax.swing.JMenuItem jmni_salir;
    private javax.swing.JTable jt_articuloseninve;
    private javax.swing.JTable jt_catainventarios;
    private javax.swing.JTable jt_eninvefamilia;
    private javax.swing.JTable jt_eninvesfamilia;
    private javax.swing.JTable jt_inventariofisicodetalle;
    private javax.swing.JTable jt_repfamilia;
    private javax.swing.JTable jt_repsubfam;
    private javax.swing.JTextArea jta_archivo;
    private javax.swing.JTable jtb_catalogo_articulos;
    private javax.swing.JTable jtb_catalogo_historialfisico;
    private javax.swing.JTextField jtf_canactual;
    private javax.swing.JTextField jtf_cananterior;
    private javax.swing.JTextField jtf_cantidad;
    private javax.swing.JTextField jtf_codconfirmaconteo;
    private javax.swing.JTextField jtf_codelabora;
    private javax.swing.JTextField jtf_codigo;
    private javax.swing.JTextField jtf_codigoinve_observa;
    private javax.swing.JTextField jtf_descripinventario;
    private javax.swing.JTextField jtf_fecha;
    private javax.swing.JTextField jtf_fecharevisa;
    private javax.swing.JTextField jtf_folio;
    private javax.swing.JTextField jtf_horainicio;
    private javax.swing.JTextField jtf_idconfirma;
    private javax.swing.JTextField jtf_idelabora;
    private javax.swing.JTextField jtf_idinve;
    private javax.swing.JTextField jtf_tienda;
    private javax.swing.JTextField jtf_totalarticulos;
    private javax.swing.JTextField jtf_totalpiezas;
    private javax.swing.JTextField jtf_ultimocodigo;
    private javax.swing.JTextField jtf_ultimoprecio;
    // End of variables declaration//GEN-END:variables

}
